#define  _CRT_SECURE_NO_WARNINGS 1
#include <stdlib.h>

struct TreeNode
{
    int val;
    struct TreeNode* left;
    struct TreeNode* right;
};

struct TreeNode* copytree(struct TreeNode* root)
{
    if (root == NULL)
    {
        return NULL;
    }
    struct TreeNode* node = (struct TreeNode*)
        malloc(sizeof(struct TreeNode));
    node->val = root->val;
    node->left = copytree(root->right);
    node->right = copytree(root->left);

    return node;
}

struct TreeNode* invertTree(struct TreeNode* root) {
    struct TreeNode* node = copytree(root);

    return node;

}